//
//  Todo.h
//  todo
//
//  Created by Brandon Trebitowski on 8/17/08.
//  Copyright 2008 __MyCompanyName__. All rights reserved.
//
//  Edited by Lily 11/19/09

#import <UIKit/UIKit.h>
#import <sqlite3.h>

@interface Todo : NSObject {
	sqlite3   *database;
	NSString  *text;
	NSString  *summary;
	NSInteger primaryKey;
	NSDate *beginDate;
	NSDate *endDate;
	
	//NSInteger priority;
	//NSInteger status;
	
	BOOL dirty;
}

@property (assign, nonatomic, readonly) NSInteger primaryKey;
@property (nonatomic, retain) NSString *text;
@property (nonatomic, retain) NSString *summary;
@property (nonatomic, retain) NSDate *beginDate;
@property (nonatomic, retain) NSDate *endDate;

//@property (nonatomic) NSInteger priority;
//@property (nonatomic) NSInteger status;

- (id)initWithPrimaryKey:(NSInteger)pk database:(sqlite3 *)db;
- (void) updateBeginDate:(NSDate *) newBeginDate;
- (void) updateEndDate:(NSDate *) newEndDate;
- (void) updateText;
- (void) updateSummary;

//- (void)updateStatus:(NSInteger) newStatus;
//- (void)updatePriority:(NSInteger) newPriority;

- (void)dehydrate;
- (void)deleteFromDatabase;
- (BOOL)isBetween:(NSDate*)dateCheck:(NSDate *)dateStart:(NSDate *)dateEnd;
+ (NSInteger)insertNewTodoIntoDatabase:(sqlite3 *)database;


@end
